import functools
def log(text):
    def decrator(fun):
        @functools.wraps(fun)
        def _warp(x):
            # _warp.__name__ = fun.__name__
            print "before"
            print text 
            fun(x)
            print "end"
        return _warp;
    return decrator;

@log("hhhhhhhh")
def test(x):
    print "ing...."+x

if __name__ == "__main__":
    #decrator(test)('----')
    test("====")
    print test.__name__
    # log('hhhhh')(test)('----')
